package com.chujian.framework.util;

import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 集合相关工具类
 */
public class CollUs {

    /**
     * 拉平List
     *
     * @param list list
     * @param <T>  T
     * @return List<T>
     */
    public static <T> List<T> flatList(List<List<T>> list) {
        return list.stream()
                .flatMap(Collection::stream)
                .collect(Collectors.toList());
    }

}
